#@adminLayout() #define main()
<link href="#(ctx)/static/ajax/libs/jquery-ztree/3.5/css/metro/zTreeStyle.css" rel="stylesheet"/>
<script src="#(ctx)/static/ajax/libs/jquery-ztree/3.5/js/jquery.ztree.all-3.5.js"></script>

<body class="gray-bg">
	<div class="container-div">
		<input id="treeId" name="treeId" type="hidden" />
		<input id="treeName" name="treeName" type="hidden"/>
		<div class="row">
	        <div class="col-sm-12 select-table table-bordered">
			    <ul id="tree" class="ztree"></ul>
			</div>
		</div>
	</div>
	
	<script type="text/javascript">
		var c_pro='#(c_pro)';
		$(function() {
			var url = "#(ctx)/sysuser/getOrgTree?c_pro="+c_pro;
			var options = {
		        url: url,
		        expandLevel: 3,
		        onClick : zOnClick
		    };
			$.tree.init(options);
		});
		
		function zOnClick(event, treeId, treeNode) {
		    var treeId = treeNode.id;
		    var treeName = treeNode.name;

   			window.parent.doSubmit(treeId,treeName);
   			var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
   			parent.layer.close(index);
		}
		
	</script>
</body>
#end